<?php 
	namespace Admin\Model;
	use Think\Model;

	class UserModel extends Model{
		public function getAll($limit){
			$list=$this->field('username,id,regtime,status')->limit($limit)->select();
			return $list;
		}

		public function getDetail($id)
		{
			$list=$this->field('
						u.`username` uname,
						u.`id` 		 uid,
						u.`regtime`  utime,
						ui.`name`    uiname,
						ui.`face`    uiface,
						ui.`sex`     uisex,
						ui.`tel`     uitel,
						ui.`qq`      uiqq,
						ui.`email`   uiemail,
						ui.`birthday` uibirth,
						ui.`age`      uiage,
						ui.`logintime` uitime')
				->table('user   u,
						user_info   ui')
				->where("u.id=ui.uid
						 and u.id=$id")
				->select();
			return $list;
			//var_dump($list);
		}
	}
?>